<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class ProductsAttr extends Model
{
    use HasFactory;
    protected $table='products_attr';
    public $timestamps=false;
    protected $guarded=[];

    public function child()
    {
        return $this->hasMany(ProductsAttr::class,'pid','id');
    }

    public function getValueAttribute($value)
    {
        return json_decode($value);
    }
}
